import App from "./App";

import Vue from "vue";
Vue.config.productionTip = false;
import store from "@/store";
import { tips } from "@/utils/tips";
import { loading } from "@/utils/loading";
import uView from "@/uni_modules/uview-ui";
import { dayjs } from "@/uni_modules/iRainna-dayjs/js_sdk/dayjs.min.js";
import { has } from "./directives/has.js";

// #ifdef APP-PLUS
// const toast = uni.requireNativePlugin("Ba-Toast");
// #endif

// import "./static/font/iconfont.css";
// import VConsole from "vconsole";
// var vConsole = new VConsole();
Vue.prototype.$dayjs = dayjs;
Vue.prototype.$tips = tips;
Vue.prototype.$loading = loading;
Vue.prototype.$has = has;
Vue.prototype.$store = store;
Vue.use(uView);

// Vue.use(vConsole);
// uni.$u.config.unit = "rpx";
uni.$off("openToast"); //清除以前的事件
uni.$on("openToast", (obj) => {
  console.log("that.$refs.uToast", obj);
  uni.showToast({
    ...obj,
    icon: "none",
    duration: 2000,
    complete: () => {
      if (obj.complete) {
        setTimeout(() => {
          obj.complete();
        }, 1000);
      }
    },
  });
});
App.mpType = "app";
new Vue({
  ...App,
}).$mount();